<?php
/*code here*/
/* Redirect user if they already logged */
if(Auth::hasAuth('current_user')){
    //$this->view->current_user = Auth::getAuth('current_user');
}
else{
    header('location: /');
}
/* if user is not admin */
    $auth = Auth::getAuth('current_user');
    // functions::userLevelAuth($auth['user_level_id']);
    
    $user_level_id = $auth['user_level_id'];
        // Allow User View
        functions::redirection_admin($user_level_id);
    
/*code here(end)*/
$auth = Auth::getAuth('current_user');
$db = new Database();
$orgchart_id = $_GET['id'];
$getCompany = $db->query("SELECT company_id FROM tborgchart WHERE id={$db->escape($orgchart_id)}","row");
if($auth['company_id']!=$getCompany['company_id'] && $orgchart_id!=0){
	header("location:/");
}

//$auth['company_id'];

$this->setLayout();